var xmlHttp; 

	function setup_ajax(){

		try{
	
			xmlHttp=new XMLHttpRequest();
		
		}catch (e){    // Internet Explorer    

			try{
	     	  	
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      
				}catch (e){      
			
					try{        
					
						xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
					
				   	}catch (e){
				
						alert("Your browser does not support AJAX!");
						return false;
					}      
			   }    
		}
	}

	function mail_send(object){
	
		if(!setup_ajax()){
		
			var url="send_email_php.php";

   			xmlHttp.open("post",url,true);
			xmlHttp.onreadystatechange=function(){ 

				if (xmlHttp.readyState==4){ 
		
					alert(xmlHttp.responseText);
		
				}
			};
			
			xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			xmlHttp.send('name=' + document.getElementById("name_" + object).value + '&email_address=' + document.getElementById("email_" + object).value + '&id=' + object); 		
		
		}
	
	}

	function toggle(object){
	
		number = object.getAttribute("number");
		
		for(x=0;x<document.getElementById("button_bar_" + number).childNodes.length;x++){
		
			document.getElementById("button_bar_" + number).childNodes[x].style.color = "#000";
			document.getElementById("button_bar_" + number).childNodes[x].style.backgroundColor = "#A9A9A9";
		
		}
		
		object.style.color = "#766B2B";
		object.style.backgroundColor = "#DAD7D2";
			
		if(object.innerHTML=="License information"){		
		
			document.getElementById("license_" + number).style.display = "block";
			document.getElementById("relation_" + number).style.display = "none";
			document.getElementById("reco_" + number).style.display = "none";
			document.getElementById("form_" + number).style.display = "none";
		
		}else if(object.innerHTML=="Related content"){
		
			document.getElementById("license_" + number).style.display = "none";
			document.getElementById("relation_" + number).style.display = "block";
			document.getElementById("reco_" + number).style.display = "none";
			document.getElementById("form_" + number).style.display = "none";
		
		}else if(object.innerHTML=="Recommend"){
		
			document.getElementById("license_" + number).style.display = "none";
			document.getElementById("relation_" + number).style.display = "none";
			document.getElementById("reco_" + number).style.display = "block";
			document.getElementById("form_" + number).style.display = "block";
		
		}

	}
